package com.group2.operations.mapper;

import com.group2.operations.model.Store;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface StoreMapper {
    /**
     * 根据代理商id查找厅店
     * @param uid
     * @return
     */
    @Select("select * from store where uid=#{uid}")
    List<Store> queryStoreByUid(int uid);

    /**
     * 通过厅店ID查询其状态
     * @param sid 厅店ID
     * @return
     */
    @Select("select closed from store where id=#{sid}")
    boolean queryStateById(int sid);

}
